/**
 * Created by Xiumin on 2016/5/3.
 */
var express = require('express');
var router = express.Router();

var dbutils = require('../src/dbutils')

/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send('respond with a resource');
});

router.get('/bit', function(req, res, next) {
    res.send('this is bit');
});

router.get('/dbtest', function(req, res, next) {
    res.send('dbtest');
});

router.get('/info', function(req, res, next) {
    var n = 100;

    var person = function (id,name,birthday,email,phone){
        this.id = id ;
        this.name = name;
        this.birthday = birthday;
        this.email = email;
        this.phone = phone;
    };
    var list = [];
    for(var i=0;i<n;i++){
        var p = new person(i,'hxq'+i,Math.ceil(Math.random()*1000),'xs@qq.com','1232344'+Math.ceil(Math.random()*1000));
        list.push(p);
    }

    res.send(list);
});

module.exports = router;